home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / srvr_tlb.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  3.1 KB  |  78 lines

  1. // ************************************************************************ //
  2. // [WARNING] [WARNING] [WARNING] [WARNING] [WARNING] [WARNING] [WARNING]    //
  3. //                                                                          //
  4. // The types declared in this file were generated from data read from a     //
  5. // Type Library. If this type library is explicitly or indirectly (via      //
  6. // another type library referring to this type library) re-imported, or the //
  7. // 'Refresh' command of the Type Library Editor activated while editing the //
  8. // Type Library, the contents of this file will be regenerated and all      //
  9. // manual modifications will be lost.                                       //
  10. // ************************************************************************ //
  11.  
  12. // ************************************************************************ //
  13. // IID\LCID: {921449E3-8905-11D1-B695-0020AF3F4B77}\0
  14. // ************************************************************************ //
  15.  
  16. #include <vcl.h>
  17. #pragma hdrstop
  18.  
  19. #include "srvr_TLB.h"
  20.  
  21. #pragma package(smart_init)
  22.  
  23. namespace Srvr_tlb
  24. {
  25.  
  26.  
  27. // *********************************************************************//
  28. // GUIDS declared in the TypeLibrary                                    //
  29. // *********************************************************************//
  30. extern "C" const GUID LIBID_srvr = {0x921449E3, 0x8905, 0x11D1,{ 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77} };
  31. extern "C" const GUID IID_IEditServer = {0x921449E4, 0x8905, 0x11D1,{ 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77} };
  32. extern "C" const GUID CLSID_EditServer = {0x921449E5, 0x8905, 0x11D1,{ 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77} };
  33.  
  34.  
  35.  
  36. // *********************************************************************//
  37. // COCLASS DEFAULT INTERFACE CREATOR
  38. // (The following methods provide an easy way to create an instance of
  39. //  the default interface, IEditServer, of the CoClass EditServer)
  40. // *********************************************************************//
  41.  
  42. HRESULT CoEditServer::Create(TCOMIEditServer& _intf)
  43. {
  44.   static TInitOle __initializeOle;
  45.   return CoCreateInstance(CLSID_EditServer, IID_IEditServer, (LPVOID*)&_intf);
  46. };
  47.  
  48. TCOMIEditServer CoEditServer::Create(void)
  49. {
  50.   TCOMIEditServer _intf;
  51.   Create(_intf);
  52.   return _intf;
  53. };
  54.  
  55. HRESULT CoEditServer::CreateRemote(LPWSTR machineName, TCOMIEditServer& _intf)
  56. {
  57.   static TInitOle __initializeOle;
  58.   COSERVERINFO ServerInfo = { 0, machineName, NULL, 0 };
  59.   MULTI_QI MQI = { &IID_IEditServer, NULL, 0 };
  60.   HRESULT _hr = ::CoCreateInstanceEx(CLSID_EditServer, NULL,
  61.                                      CLSCTX_LOCAL_SERVER|
  62.                                      CLSCTX_REMOTE_SERVER|
  63.                                      CLSCTX_INPROC_SERVER,
  64.                                      &ServerInfo, 1, &MQI);
  65.   if (SUCCEEDED(_hr))
  66.     _intf = (IEditServer*)MQI.pItf;
  67.   return _hr;
  68. };
  69.  
  70. TCOMIEditServer CoEditServer::CreateRemote(LPWSTR machineName)
  71. {
  72.   TCOMIEditServer _intf;
  73.   CreateRemote(machineName, _intf);
  74.   return _intf;
  75. };
  76.  
  77. };     // namespace Srvr_tlb
  78.